<?php
session_start(); //开启会话
//先判断管理员是否登录，本页面只有管理员登录后才能访问
header('content-type:text/html;charset=utf-8');
if (!isset($_SESSION['admin']) or !$_SESSION['admin']) {  //说明未登录
    echo "<script>alert('本页面需要管理员登录后才能访问，请以管理员身份登录！');location.href='login.html';</script>";
    exit;
}
$id = $_GET['id'];
include_once "conn.php";
$sql = "delete from userinfo where id = $id";
$result = mysqli_query($conn,$sql);
if($result){
    echo "<script>alert('删除会员成功！');location.href='admin.php';</script>";
}
else{
    echo "<script>alert('删除会员失败！');history.back();</script>";
}

?>